/*
 * $TEAM_NAME Space Trader
 */
import models.StarSystem;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNotNull;

import java.awt.geom.Point2D;

/**
 * Tests the StarSystem model.
 * @author twb
 * @version 1.0
 */
public class StarSystemTest {
    /**
     * Star System being tested.
     */
    private static final StarSystem ss = 
        StarSystem.randomStarSystemWithName("Test");

    /**
     * Verify the name.
     */
    @Test
    public void nameTest() {
        assertEquals("name", "Test", ss.getName());
    }

    /**
     * Verify the coordinates.
     */
    @Test
    public void locationTest() {
        Point2D location = ss.getLocation();
        double x = location.getX();
        double y = location.getY();

        assertTrue("location", x <= 1.0);
        assertTrue("location", x >= 0.0);
        assertTrue("location", y <= 1.0);
        assertTrue("location", y >= 0.0);
    }

    /**
     * Verify that the star system has a marketplace.
     */
    @Test
    public void marketPlaceTest() {
        assertNotNull("marketplace", ss.getMarketplace());
    }

    /**
     * Verify that the star system has a shipyard.
     */
    @Test
    public void shipyardTest() {
        assertNotNull("shipyard", ss.getShipyard());
    }
}
